home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / text / hyper / ADtoHT2_1.lha / Source.lha / MyLib.lha / Introduction.doc < prev    next >
Encoding:
Text File  |  1995-04-22  |  4.2 KB  |  108 lines

  1. MyLib.lib/--Introduction--                          MyLib.lib/--Introduction--
  2.  
  3.     GENERAL
  4.     MyLib.lib is my personal link library. It consists of several parts:
  5.       - ANSI/ISO-C compliant functions
  6.       - "not quite, but somewhat" ANSI/ISO-C compliant functions
  7.       - Amiga specific functions
  8.       - MUI support
  9.  
  10.     The primary goal of MyLib.lib is not ANSI/ISO compliance; instead
  11.     it is targeted at writing Amiga programs.
  12.  
  13.     MyLib.lib requires AmigaOS 2.04 (V37) or newer; this is ensured by
  14.     the startup code (specifically, it makes sure you have dos.library V37
  15.     and utility.library V37. Usually this means you're running at least
  16.     AmigaOS 2.04).
  17.  
  18.     MyLib.lib enables you to write programs that can be compiled with
  19.     any compiler. Currently supported compilers are SAS/C 5.10b and
  20.     GNU-C (currently 2.6.3).
  21.  
  22.     AMIGA SUPPORT
  23.     __asm is available. See the AsmStub program documentation.
  24.     __interrupt is available. See the AsmStrub program documentation.
  25.     __saveds is only available in conjunction with __asm or __interrupt.
  26.              It cannot be used for functions taking parameters on the
  27.              stack (but it can be used for functions taking no parameters).
  28.              See the AsmStub program documentation.
  29.     __aligned is available, see ALIGN().
  30.     __chip is not available.
  31.     __fast will never be available, even if GNU-C supports it. There
  32.            is no need to ever use __fast.
  33.  
  34.     clib/muimaster.h, inline/muimaster.h and proto/muimaster.h are
  35.     provided.
  36.  
  37.     COMPILER SUPPORT
  38.     __aligned is available, see ALIGN().
  39.     inline is provided as INLINE.
  40.     __far is not available since GNU-C doesn't have it.
  41.     attribute((noreturn)) is available, see NORETURN.
  42.  
  43.     COMPILING
  44.     MyLib.lib requires that the following preprocessor symbols are
  45.     defined during compilation to match the corresponding compiler
  46.     options:
  47.       SMALL_DATA    when compiling baserelative code
  48.       SMALL_CODE    when compiling with small code model
  49.  
  50.     Not defining SMALL_CODE when compiling small code is usually
  51.     harmless; not defining SMALL_DATA when compiling baserelative
  52.     will produce garbage. I believe that defining SMALL_DATA
  53.     when not compiling baserelative is safe.
  54.  
  55.     A library is provided for each of the four possible combinations
  56.     of small code and baserelative adressing; the library to be used
  57.     can be found in a directory whose name is constructed following
  58.     these rules:
  59.       - a four letter compiler identifier. Currently implemented are
  60.           SAS5 for SAS/C V5.10b
  61.           GNUC for GNU-C (2.6.3)
  62.       - a 'b' if baserelative adressing is to be used
  63.       - a 's' if small code is to be used
  64.     Example: the small-code, not baserelative library for GNU-C is
  65.     called GNUCs/libMyLib.a.
  66.  
  67.     GNU-C
  68.     For GNU-C, you might want to add -DSMALL_DATA and -DSMALL_CODE
  69.     to your specs file to define them automatically for -fbaserel
  70.     and -msmall-code, resp.
  71.  
  72.     The following options are required:
  73.       Preprocessor: -nostdinc -I. -I- -I/gnu/MyLib -I/gnu/os-include
  74.                     -I/gnu/include [-DSMALL_CODE] [-DSMALL_DATA]
  75.       Linker: -nostdlib MyLibDirectory/GNUC[b][s]/MyStartup.o
  76.               [your objects] MyLibDirectory/GNUC[b][s]/libMyLib.a
  77.               -lamiga [-fbaserel]
  78.  
  79.     SAS/C V5.10b
  80.     For SAS/C, you must not use stack checking.
  81.     
  82.     The following options are required:
  83.       Compiler: -v -iINCLUDE:MyLib/
  84.       Linker: FROM MyLibDirectory/SAS5[b][s]/MyStartup.o [your objects]
  85.               LIB MyLibDirectory/SAS5[b][s]/MyLib.lib LIB:amiga.lib
  86.               LIB:lc.lib
  87.  
  88.     NOTE
  89.     Depending on your setup, the original header files provided by the
  90.     compiler vendor may still be accessible. Do not use them! MyLib.lib
  91.     is not designed to be compatible to some existing library, or even
  92.     to existing header files. This is contrary to libnix, which uses the
  93.     orginal header files that come with Amiga GNU-C.
  94.  
  95.     Of course, MyLib works with the Commodore Amiga headers.
  96.  
  97.     NOTE
  98.     For SAS/C V5.10b only:
  99.       Currently your programs are linked with lc.lib for SAS/C. This does
  100.       not imply that you are allowed to use functions from lc.lib! You
  101.       must not use such functions; be careful. lc.lib is required for
  102.       integer math functions; I'll hopefully be able to eliminate the
  103.       need for lc.lib at some time.
  104.  
  105.       The proto/alib.h file that came with SAS/C is broken. Replace it
  106.       with a file that only does #include <clib/alib_protos.h>, or
  107.       create a link. That will magically fix "strange" compiler errors.
  108.